<%@ page contentType="text/html; charset=utf-8"%>
<%@ taglib uri="struts-html.tld" prefix="html"%>
<%@ taglib uri="struts-tiles.tld" prefix="tiles"%>
<%@ taglib uri="struts-logic.tld" prefix="logic"%>
<%@ taglib uri="struts-bean.tld" prefix="bean"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<%
	String path = request.getContextPath();
	String merchantUrl = request.getParameter("merchantUrl");
	String orderId = request.getParameter("orderId");
	String amount = request.getParameter("amount");
	String cardNo = request.getParameter("cardNo");
	String password = request.getParameter("password");
	String returnCode = "0000";
	String errorMessage = "";
	if(cardNo==null||cardNo.length()==0){
		returnCode = "0101";
		errorMessage="卡号不能为空！";
	}else{
		try{
			Long.parseLong(cardNo);
			if(password==null||password.length()==0){
				returnCode = "0103";
				errorMessage="密码错误！";
			}
		}catch(NumberFormatException e){
			returnCode = "0102";
			errorMessage = "非法卡号！";
		}
	}
	boolean failed = errorMessage.length()>0;
%>
<title>模拟网上银行支付</title>
<link href="<%=path%>/css/sinfo.css" rel="stylesheet" type="text/css" />
<link href="<%=path%>/css/style.css" rel="stylesheet" type="text/css" />
<link href="<%=path%>/css/newstyle.css" rel="stylesheet" type="text/css" />
<link href="<%=path%>/css/common.css" rel="stylesheet" type="text/css" />

</head>

<body>
<form name="MockBankResponseForm" action="<%=merchantUrl%>" target="_self" method="post">
  <input type="hidden" name="orderId" value="<%=orderId%>"/>
  <input type="hidden" name="amount" value="<%=amount%>"/>
  <input type="hidden" name="returnCode" value="<%=returnCode%>"/>
  <input type="hidden" name="errorMessage" value="<%=errorMessage%>"/>
  <table width="732" border="0" align="center" cellpadding="0" cellspacing="3" bgcolor="0EA2D6">
    <tr> 
      <td  bgcolor="#FFFFFF"><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr> 
            <td height="25" align="center" background="<%=path%>/images/new/blue_pic_01.gif"><strong><font color="#FFFFFF" style="font-size:12px"> 
              操作提示</font></strong></td>
          </tr>
        </table>
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr> 
            <td height="8" ><img src="<%=path%>/images/new/blue_pic_02.gif" width="726" height="8" /></td>
          </tr>
        </table>
        <table width="100%" border="0" cellspacing="0" cellpadding="8">
          <tr> 
            <td> <div class="panel"> 
                <table width="98%" border="0" cellspacing="1" cellpadding="4">
                  <tr bgcolor="#F0FAFD"> 
                    <td height="150" align="center"><strong><font color="#FF0000">
                    <% if(failed){ %>
                    错误：<%=errorMessage%>
                    <% }else{ %>
                    模拟银行在线支付成功!
                    <% } %>
                    </font></strong></td>
                  </tr>
                </table>
                <table width="98%" border="0" cellspacing="1" cellpadding="4">
                  <tr> 
                    <td  align="right"><hr noshade="noshade" size="2" color="#0EA2D6" /></td>
                  </tr>
                </table>
              <table width="98%" border="0" cellspacing="0" cellpadding="4">
                <tr> 
	                  <td align="center"> 
	                    <button type="button" onClick="window.close()" class="button_3">关闭</button></td>
	                </tr>
	              </table>
              </div></td>
          </tr>
        </table></td>
    </tr>
  </table>
  </form>
<script language="javascript">
document.MockBankResponseForm.submit();
</script>
</body>

</html>
